<!--钢筋保护层检测---钢筋保护层检测-1---查看-->
<template>
  <div class="department">
    <!-- 左侧部门管理 -->
    <div class="structureTree" v-if="treelength">
      <div class="structureTree_title">
        <div>组织机构</div>
        <div>
          <el-checkbox v-model="checked" @change="see()">查看下级</el-checkbox>
        </div>
      </div>
      <tree
        :treeData="treeData"
        :checkData="checkData"
        name="engineerList"
        nodeKey="fCompanyid"
        @getTreeInfo="handleNodeClick"
        :defaultProps="defaultProps"
      >
      </tree>
    </div>
    <!-- 右侧 -->
    <div class="department_right">
      <!-- 机构名称 -->
      <div class="department_right_name">
        <div>{{ showName }}</div>
      </div>
      <!-- 顶部导航栏 -->
      <div class="mechanism_nav">
        <!-- 左侧 -->
        <div class="mechanism_nav_left left_select"></div>
        <!-- 顶部按钮 -->
        <div class="print">
          <div class="printTable">
            <el-button
              type="primary"
              icon="el-icon-refresh"
              size="small"
              @click="getDataList(getList)"
            ></el-button>

            <el-button
              type="primary"
              v-if="yj_view"
              icon="el-icon-search"
              size="small"
              @click="editText(this.row, 1)"
              >查看
            </el-button>
          </div>
        </div>
      </div>

      <!-- 表格 -->
      <div class="text_table">
        <el-table
          ref="multipleTableA"
          v-loading="loading"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
          @row-click="getRowInfo"
          :data="tableData"
          style="width: 100%"
          :height="navigatepageNums > 1 ? 'calc(100% - 50px)' : '100%'"
          stripe
          border
          highlight-current-row
          @current-change="rowChange"
        >
          <el-table-column
            fixed
            type="index"
            label="序号"
            width="50"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="fProjectname" label="建设项目简称" width="180">
            <!-- 超出鼠标滑过显示 -->
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fProjectname">{{
                  scope.row.fProjectname
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fChecktype" label="检测类型" width="150">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fChecktype">{{
                  scope.row.fChecktype
                }}</a>
              </div>
            </template>
          </el-table-column>

          <el-table-column
            prop="fCheckcompanyname"
            label="检测单位"
            width="150"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fCheckcompanyname">{{
                  scope.row.fCheckcompanyname
                }}</a>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="fClientname" label="施工/委托单位" width="120">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fClientname">{{
                  scope.row.fClientname
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fReportnumber"
            label="报告编号"
            width="180"
            align="center"
          >
            <template slot-scope="scope">
              <el-button
                @click="editText(scope.row, 2)"
                @cell-dblclick="editText"
                type="text"
                size="small"
                style="padding: 0 !important; margin: 0"
              >
                {{ scope.row.fReportnumber }}
              </el-button>
            </template>
          </el-table-column>
          <el-table-column
            prop="fReportdates"
            label="报告日期"
            width="120"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fReportdates">{{
                  scope.row.fReportdates
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fSamplenumber"
            label="样品编号"
            width="180"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fSamplenumber">{{
                  scope.row.fSamplenumber
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fRecordnumber"
            label="记录编号"
            width="180"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fRecordnumber">{{
                  scope.row.fRecordnumber
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fProjectpartandapp"
            label="工程部位/用途"
            width="200"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fProjectpartandapp">{{
                  scope.row.fProjectpartandapp
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fCheckdates"
            label="试验检测日期"
            width="100"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fCheckdates">{{
                  scope.row.fCheckdates
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fCheckreference"
            label="检测依据"
            width="120"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fCheckreference">{{
                  scope.row.fCheckreference
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fDecidereference"
            label="判定依据"
            width="120"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fDecidereference">{{
                  scope.row.fDecidereference
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="fCreateusername"
            label="记录人"
            width="80"
            align="center"
          >
          </el-table-column>
          <el-table-column label="记录表" width="80" align="center">
            <template slot-scope="scope">
              <el-button
                @click="editText(scope.row, 3)"
                @cell-dblclick="editText"
                type="text"
                size="small"
                style="padding: 0 !important; margin: 0"
              >
                记录表
              </el-button>
            </template>
          </el-table-column>
          <el-table-column label="报告" width="100" align="center">
            <template slot-scope="scope">
              <el-button
                @click="editText(scope.row, 4)"
                @cell-dblclick="editText"
                type="text"
                size="small"
                style="padding: 0 !important; margin: 0"
              >
                报告
              </el-button>
            </template>
          </el-table-column>
          <template slot="empty">
            <img
              style="width: 285px; height: 208px"
              src="@/assets/img/undata.png"
              alt=""
            />
            <div class="pageFlagText">暂时没有数据哦！</div>
          </template>
        </el-table>
        <div
          class="block"
          v-if="navigatepageNums > 1"
          :style="{
            width: treelength ? 'calc(100vw - 430px)' : 'calc(100vw - 241px)',
          }"
        >
          <div class="paginationInfo">
            检索到{{ queryCriteriaData.total }} 条记录 | 显示第
            {{ getList.page }}
            <!-- - {{ 20 * getList.page }} 条记录 -->
            <span v-if="queryCriteriaData.pages == queryCriteriaData.lastPage">
              {{ queryCriteriaData.total }}</span
            >
            <span v-else> {{ 20 * getList.page }} </span>
            条记录
          </div>
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="getList.page"
            :page-size="getList.pageSize"
            layout="prev, pager, next, jumper"
            :total="queryCriteriaData.total"
          >
          </el-pagination>
        </div>
      </div>
      <!-- 查看 -->
      <div class="steelSheet Control-1 big_dialog">
        <el-dialog
          title="查看"
          v-dialogDrag
          :visible.sync="dialogTableVisible"
          v-loading="loadingDialog"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
          >
            <el-menu-item index="1">钢筋保护层厚度试验检测记录表</el-menu-item>
            <el-menu-item index="2">钢筋保护层厚度试验检测报告</el-menu-item>
            <el-menu-item index="3">钢筋保护层厚度检测示意图</el-menu-item>
          </el-menu>
          <div
            v-show="activeIndex == '1'"
            class="dialogBody common"
            :style="{ height: dialogHeight }"
          >
            <header>
              钢筋保护层厚度试验检测记录表
              <div class="printTable">
                <el-button
                  type="primary"
                  icon="el-icon-printer"
                  size="small"
                  @click="Print(1)"
                  >打印表格
                </el-button>
              </div>
            </header>
            <!-- 检测类型 -->
            <div
              class="top_box top_1"
              style="border-bottom: 1px solid #ccc"
              id="checkForm1"
            >
              <div class="bottom1_1" style="background: #f5f7fa">
                检测类型：
              </div>
              <div class="bottom1_2" v-text="formData.fChecktype"></div>
            </div>
            <!-- 头部 -->
            <div class="title">
              <div class="title_Name title_record">
                <div class="title_input_text">检测单位名称：</div>
                <div
                  class="title_input_con"
                  v-text="formData.fCheckcompanyfullname"
                ></div>
              </div>
              <div class="title_input">
                <div class="title_input_text">记录编号：</div>
                <div
                  class="title_input_con"
                  v-text="formData.fRecordnumber"
                ></div>
              </div>
            </div>
            <!-- 工程名称 -->
            <div class="top_box top_1">
              <div class="bottom1_1" style="background: #f5f7fa">工程名称</div>
              <div class="bottom1_2" v-text="formData.fProjectfullname"></div>
            </div>
            <!-- 工程部位/用途 -->
            <div class="top_box top_1" id="checkForm2">
              <div class="bottom1_1">工程部位/用途</div>
              <div class="bottom1_2" v-text="formData.fProjectpartandapp"></div>
            </div>
            <!-- 样品信息 -->
            <div class="top_box top_1" id="checkForm3">
              <div class="bottom1_1">样品信息</div>
              <div class="bottom1_2" v-text="sample"></div>
            </div>
            <!-- 试验检测日期 -->
            <div class="top_box top_1">
              <div class="top_4">
                <div class="bottom1_1">试验检测日期</div>
                <div class="bottom1_2" v-text="formData.fCheckdates"></div>
              </div>
              <div class="top_4" id="checkForm4">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  试验条件
                </div>
                <div
                  class="bottom1_2"
                  v-text="formData.fCheckenvironment"
                ></div>
              </div>
            </div>
            <!-- 检测依据 -->
            <div class="top_box top_1">
              <div class="top_4" id="checkForm5">
                <div class="bottom1_1">检测依据</div>
                <div class="bottom1_2" v-text="formData.fCheckreference"></div>
              </div>
              <div class="top_4" id="checkForm6">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  判定依据
                </div>

                <div class="bottom1_2" v-text="formData.fDecidereference"></div>
              </div>
            </div>
            <!-- 主要仪器设备名称及编号 -->
            <div class="top_box top_1 top_2" id="checkForm7">
              <div class="bottom1_1">主要仪器设备<br />名称及编号</div>
              <div
                class="bottom1_2"
                v-text="formData.fMajorequipnameandnumber"
              ></div>
            </div>
            <!-- 钢筋工称直径 -->
            <div class="top_box top_1">
              <div class="top_4 top_3" id="checkForm8">
                <div class="bottom1_1">钢筋公称直径</div>
                <div class="bottom1_2" v-text="formData.fDiameter"></div>
              </div>
              <div class="top_4 top_3" id="checkForm9">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  修正值
                </div>
                <div class="bottom1_2" v-text="formData.fCc"></div>
              </div>
            </div>
            <!-- 报告编号 -->
            <div class="top_box top_1">
              <div class="top_4 top_3">
                <div class="bottom1_1">报告编号</div>
                <div class="bottom1_2" v-text="formData.fReportnumber"></div>
              </div>
              <div class="top_4 top_3">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  报告日期
                </div>
                <div class="bottom1_2" v-text="formData.fReportdates"></div>
              </div>
            </div>
            <!-- 构件名称 -->
            <div class="top_box top_1">
              <div class="top_4 top_3" id="checkForm10">
                <div class="bottom1_1">构件名称</div>
                <div class="bottom1_2" v-text="formData.fComponentname"></div>
              </div>
              <div class="top_4 top_3" id="checkForm12">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  钢筋保护层厚度设计值Dnd(mm)
                </div>
                <div class="bottom1_2" v-text="formData.fDnd"></div>
              </div>
            </div>
            <!-- 垫块厚度C -->
            <div class="top_box top_1">
              <div class="top_4 top_3" id="checkForm11">
                <div class="bottom1_1">垫块厚度C(mm)</div>
                <div class="bottom1_2" v-text="formData.fCo"></div>
              </div>
              <div class="top_4 top_3">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  规定值或允许偏差(mm)
                </div>
                <div class="bottom1_2" v-text="formData.fStandardvalue"></div>
              </div>
            </div>
            <!-- 钢筋保护层厚度判定系数 -->
            <div class="top_box top_1 top_5">
              <div class="bottom1_1">钢筋保护层厚度判定系数</div>

              <div
                class="bottom1_2"
                v-text="formData.fThicknessdecidecoefficient"
              ></div>
            </div>
            <!-- 表格 -->
            <div class="table_recordSheet">
              <!-- 左侧数据1-20 -->
              <div
                class="recordSheet"
                style="width: 50%; box-sizing: border-box"
              >
                <el-table style="width: 100%; box-sizing: border-box">
                  <el-table-column label="测点编号" width="47.5">
                  </el-table-column>
                  <el-table-column label="钢筋公称直径 (mm)" width="69.75">
                  </el-table-column>
                  <el-table-column label="保护层厚度检测值(mm)">
                    <el-table-column label="第一次检测值" width="70.75">
                    </el-table-column>
                    <el-table-column label="第二次检测值" width="70.75">
                    </el-table-column>
                    <el-table-column label="修正值" width="69.75">
                    </el-table-column>
                    <el-table-column label="平均检测值" width="70.75">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="偏差值(mm)" width="69.75">
                  </el-table-column>
                </el-table>
                <div
                  class="recordSheet_box"
                  v-for="(v, i) in recordData"
                  :key="i"
                >
                  <div class="recordSheet_box_1 row1_1">
                    <el-input
                      v-model="v.fCheckpointnumber"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_2 row1_2">
                    <el-input
                      v-model="v.fDiameter"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_3 row1_3">
                    <el-input
                      v-model="v.fFirstcheckvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_3 row1_4">
                    <el-input
                      v-model="v.fSecondcheckvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_2 row1_5">
                    <el-input
                      v-model="v.fCc"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_3 row1_6">
                    <el-input
                      v-model="v.fAvgvalue"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_4 row1_7" style="border: none">
                    <el-input
                      v-model="v.fSdvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                </div>
              </div>
              <!-- 右侧数据21-40 -->
              <div
                class="recordSheet"
                style="
                  width: 50%;
                  box-sizing: border-box;
                  border-right: 1px solid #ccc;
                "
              >
                <el-table style="width: 100%; box-sizing: border-box">
                  <el-table-column label="测点编号" width="47.5">
                  </el-table-column>
                  <el-table-column label="钢筋公称直径 (mm)" width="69.75">
                  </el-table-column>

                  <el-table-column label="保护层厚度检测值(mm)">
                    <el-table-column label="第一次检测值" width="70.75">
                    </el-table-column>
                    <el-table-column label="第二次检测值" width="70.75">
                    </el-table-column>
                    <el-table-column label="修正值" width="69.75">
                    </el-table-column>
                    <el-table-column label="平均检测值" width="70.75">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="偏差值(mm)" width="69.75">
                  </el-table-column>
                </el-table>
                <div
                  class="recordSheet_box"
                  v-for="(v, i) in recordData1"
                  :key="i"
                >
                  <div class="recordSheet_box_1 row1_1">
                    <el-input
                      v-model="v.fCheckpointnumber"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_2 row1_2">
                    <el-input
                      v-model="v.fDiameter"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_3 row1_3">
                    <el-input
                      v-model="v.fFirstcheckvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_3 row1_4">
                    <el-input
                      v-model="v.fSecondcheckvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_2 row1_5">
                    <el-input
                      v-model="v.fCc"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_3 row1_6">
                    <el-input
                      v-model="v.fAvgvalue"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_4 row1_7" style="border: none">
                    <el-input
                      v-model="v.fSdvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                </div>
              </div>
            </div>
            <!--底部 第一行 -->
            <div class="bottom_box">
              <div class="bottom1_1">保护层厚度检测点数</div>
              <div class="bottom1_2" v-text="formData.fCheckpointcount"></div>
              <div class="bottom1_3" style="border-left: #ccc 1px solid">
                合格点数
              </div>
              <div
                class="bottom1_4"
                v-text="formData.fCheckpointqualifiedcount"
              ></div>
              <div class="bottom1_5">合格率(%)</div>
              <div
                class="bottom1_6"
                v-text="formData.fCheckpointqualifiedrate"
              ></div>
            </div>
            <!--底部 第二行 -->
            <div class="bottom_box">
              <div class="bottom1_1">保护层厚度平均值<span>D</span>n(mm)</div>
              <div
                class="bottom1_2"
                v-text="formData.fCheckpointavgthickness"
              ></div>
              <div class="bottom1_3" style="border-left: #ccc 1px solid">
                标准偏差(mm)
              </div>
              <div class="bottom1_4" v-text="formData.fSd"></div>
              <div class="bottom1_5">保护层厚度特征值(mm)</div>
              <div class="bottom1_6" v-text="formData.fDne"></div>
            </div>
            <!-- 检测部位示意图 -->
            <div class="bottom_box box2">
              <div class="bottom1_1">检测部位示意图</div>
              <div class="bottom1_2">
                <div
                  ref="fPhotofilelist"
                  style="
                    height: 25px;
                    line-height: 25px;
                    width: 100%;
                    display: flex;
                    border-radius: 5px;
                    margin: 8px 0 2px 0;
                  "
                >
                  <div
                    v-for="(v, i) in fPhotofilelist"
                    :key="i"
                    style="margin: 2px 3px; height: 87%"
                    @click="openPdfs(v)"
                  >
                    <img
                      style="max-width: 100%; max-height: 100%"
                      src="@/assets/img/pdf.png"
                    />
                  </div>
                </div>
              </div>
            </div>
            <!-- 附加声明 -->
            <div class="bottom_box box2">
              <div class="bottom1_1">附加声明</div>
              <div class="bottom1_2" v-text="formData.fAddcomments"></div>
            </div>
          </div>

          <!-- 钢筋保护层厚度试验检测报告 -->
          <div
            v-show="activeIndex == '2'"
            class="dialogBody common reportSheet"
            :style="{ height: dialogHeight }"
          >
            <header>
              钢筋保护层厚度试验检测报告
              <div class="printTable">
                <el-button
                  type="primary"
                  icon="el-icon-printer"
                  size="small"
                  @click="Print(2)"
                  >打印表格
                </el-button>
              </div>
            </header>
            <!-- 检测类型 -->
            <div
              class="top_box top_1"
              style="border-bottom: 1px solid #ccc"
              id="checkForm1"
              v-show="false"
            ></div>
            <!-- 头部 -->
            <div class="title">
              <div class="title_Name">
                <div class="title_input_text">检测单位名称(专用章):</div>
                <div
                  class="title_input_con"
                  v-text="formData.fCheckcompanyfullname"
                ></div>
              </div>
              <div class="title_input">
                <div class="title_input_text">报告编号：</div>
                <div
                  class="title_input_con"
                  v-text="formData.fReportnumber"
                ></div>
              </div>
            </div>
            <!-- 施工/委托单位 -->
            <div class="top_box top_1 top_2">
              <div class="top_4">
                <div class="bottom1_1" style="line-height: 40px !important">
                  施工/委托单位
                </div>

                <div class="bottom1_2" v-text="formData.fClientfullname"></div>
              </div>
              <div class="top_4">
                <div
                  class="bottom1_1"
                  style="
                    border-left: 1px solid #ccc;
                    line-height: 40px !important;
                  "
                >
                  工程名称
                </div>
                <div class="bottom1_2" v-text="formData.fProjectfullname"></div>
              </div>
            </div>
            <!-- 工程部位/用途 -->
            <div class="top_box top_1">
              <div class="bottom1_1">工程部位/用途</div>
              <div class="bottom1_2" v-text="formData.fProjectpartandapp"></div>
            </div>
            <!-- 样品信息 -->
            <div class="top_box top_1">
              <div class="bottom1_1">样品信息</div>
              <div class="bottom1_2" v-text="sample"></div>
            </div>
            <!-- 检测依据 -->
            <div class="top_box top_1">
              <div class="top_4">
                <div class="bottom1_1">检测依据</div>
                <div class="bottom1_2" v-text="formData.fCheckreference"></div>
              </div>
              <div class="top_4">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  判定依据
                </div>

                <div class="bottom1_2" v-text="formData.fDecidereference"></div>
              </div>
            </div>
            <!-- 主要仪器设备名称及编号 -->
            <div class="top_box top_1 top_2">
              <div class="bottom1_1">主要仪器设备<br />名称及编号</div>
              <div
                class="bottom1_2"
                v-text="formData.fMajorequipnameandnumber"
              ></div>
            </div>
            <!-- 龄期 -->
            <div class="top_box top_1">
              <div class="top_4">
                <div class="bottom1_1">龄期(d)</div>
                <div class="bottom1_2" v-text="formData.fAge"></div>
              </div>
              <div class="top_4">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  设计强度等级
                </div>
                <div class="bottom1_2" v-text="formData.fDesignintensity"></div>
              </div>
            </div>
            <!-- 构件名称 -->
            <div class="top_box top_1 box2">
              <div class="top_4 top_3">
                <div class="bottom1_1">构件名称</div>
                <div class="bottom1_2" v-text="formData.fComponentname"></div>
              </div>
              <div class="top_4 top_3">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  钢筋保护层厚度设计值Dnd(mm)
                </div>
                <div class="bottom1_2" v-text="formData.fDnd"></div>
              </div>
            </div>
            <!-- 垫块厚度C -->
            <div class="top_box top_1 box2">
              <div class="top_4 top_3">
                <div class="bottom1_1">垫块厚度C(mm)</div>
                <div class="bottom1_2" v-text="formData.fCo"></div>
              </div>
              <div class="top_4 top_3">
                <div class="bottom1_1" style="border-left: 1px solid #ccc">
                  规定值或允许偏差(mm)
                </div>
                <div class="bottom1_2" v-text="formData.fStandardvalue"></div>
              </div>
            </div>
            <!-- 表格 -->
            <div class="table_recordSheet table_report">
              <!-- 左侧数据1-20 -->
              <div
                class="recordSheet"
                style="width: 50%; box-sizing: border-box"
              >
                <el-table style="width: 100%; box-sizing: border-box">
                  <el-table-column prop="num" label="测点编号" width="93">
                  </el-table-column>
                  <el-table-column label="钢筋公称直径 (mm)" width="92">
                  </el-table-column>
                  <el-table-column
                    label="保护层厚度检测值 (mm)"
                    width="93"
                    style="padding: 0"
                  >
                  </el-table-column>
                  <el-table-column label="偏差值 (mm)" width="93">
                  </el-table-column>
                  <el-table-column
                    label="结果判定 "
                    width="93"
                    class-name="table_end"
                  >
                  </el-table-column>
                </el-table>
                <div
                  class="recordSheet_box"
                  v-for="(v, i) in recordData"
                  :key="i"
                  style="border-right: none"
                >
                  <div class="recordSheet_box_1 row1_1">
                    <el-input
                      v-model="v.fCheckpointnumber"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_2">
                    <el-input
                      v-model="v.fDiameter"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_3">
                    <el-input
                      v-model="v.fAvgvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_4">
                    <el-input
                      v-model="v.fSdvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_5" style="border: none">
                    <el-input
                      v-model="v.fResultdecide"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                </div>
              </div>
              <!-- 右侧数据21-40 -->
              <div
                class="recordSheet"
                style="
                  width: 50%;
                  box-sizing: border-box;
                  border-right: 1px solid #ccc;
                "
              >
                <el-table style="width: 100%; box-sizing: border-box">
                  <el-table-column prop="num" label="测点编号" width="93">
                  </el-table-column>
                  <el-table-column
                    prop="diameter"
                    label="钢筋公称直径 (mm)"
                    width="92"
                  >
                  </el-table-column>
                  <el-table-column
                    prop="diameter"
                    label="保护层厚度检测值 (mm)"
                    width="93"
                  >
                  </el-table-column>
                  <el-table-column
                    prop="diameter"
                    label="偏差值 (mm)"
                    width="93"
                  >
                  </el-table-column>
                  <el-table-column prop="diameter" label="结果判定 " width="93">
                  </el-table-column>
                </el-table>
                <div
                  class="recordSheet_box"
                  v-for="(v, i) in recordData1"
                  :key="i"
                  style="border-right: none"
                >
                  <div class="recordSheet_box_1 row1_1">
                    <el-input
                      v-model="v.fCheckpointnumber"
                      placeholder="/"
                      disabled
                      class="center_text"
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_2">
                    <el-input
                      v-model="v.fDiameter"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_3">
                    <el-input
                      v-model="v.fAvgvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_4">
                    <el-input
                      v-model="v.fSdvalue"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                  <div class="recordSheet_box_1 row1_5" style="border: none">
                    <el-input
                      v-model="v.fResultdecide"
                      placeholder="/"
                      class="center_text"
                      disabled
                    ></el-input>
                  </div>
                </div>
              </div>
            </div>
            <!--底部 第一行 -->
            <div class="bottom_box">
              <div class="bottom1_1">保护层厚度检测点数</div>
              <div class="bottom1_2" v-text="formData.fCheckpointcount"></div>
              <div class="bottom1_3" style="border-left: #ccc 1px solid">
                合格点数
              </div>
              <div
                class="bottom1_4"
                v-text="formData.fCheckpointqualifiedcount"
              ></div>
              <div class="bottom1_5">合格率(%)</div>
              <div
                class="bottom1_6"
                v-text="formData.fCheckpointqualifiedrate"
              ></div>
            </div>
            <!--底部 第二行 -->
            <div class="bottom_box">
              <div class="bottom1_1">保护层厚度平均值<span>D</span>n(mm)</div>
              <div
                class="bottom1_2"
                v-text="formData.fCheckpointavgthickness"
              ></div>
              <div class="bottom1_3" style="border-left: #ccc 1px solid">
                标准偏差(mm)
              </div>
              <div class="bottom1_4" v-text="formData.fSd"></div>
              <div class="bottom1_5">保护层厚度特征值(mm)</div>
              <div class="bottom1_6" v-text="formData.fDne"></div>
            </div>
            <!-- 保护层厚度特征值与设计值的比值Dne/Dnd -->
            <div
              class="top_box top_1 top_5 box2"
              style="border-bottom: 1px solid #ccc; border-top: none"
            >
              <div class="bottom1_1">保护层厚度特征值与设计值的比值Dne/Dnd</div>

              <div class="bottom1_2" v-text="formData.fRatioofdneanddnd"></div>
            </div>
            <!-- 检测结论 -->
            <div class="bottom_box box2">
              <div class="bottom1_1">检测结论</div>
              <div class="bottom1_2">
                <div
                  v-text="formData.fCheckresult"
                  style="line-height: 20px"
                ></div>
              </div>
            </div>
            <!-- 附加声明 -->
            <div class="bottom_box box2">
              <div class="bottom1_1">附加声明</div>
              <div class="bottom1_2" v-text="formData.fAddcomments"></div>
            </div>
          </div>
          <!-- 钢筋保护层厚度检测示意图 -->
          <div
            v-show="activeIndex == '3'"
            class="dialogBody common"
            :style="{ height: dialogHeight }"
          >
            <header>钢筋保护层厚度检测示意图</header>
            <div class="ThicknessMap">
              <div class="Thickness_Map">
                <SteelCharts
                  v-loading="chartsLoading"
                  element-loading-text="拼命加载中"
                  element-loading-spinner="el-icon-loading"
                  element-loading-background="rgba(0, 0, 0, 0.3)"
                  :commonData="tensioningData"
                  :height="echartsHeight"
                >
                </SteelCharts>
              </div>
              <div class="Thickness_Form">
                <div class="Thickness_Form_box">
                  <div class="box1" style="background: aliceblue">
                    <div>序号</div>
                    <div>位置</div>
                    <div>厚度</div>
                    <div>间距</div>
                    <div>合格</div>
                  </div>
                  <div
                    class="box1"
                    v-for="(item, index) in Thickness_FormData_right"
                    :key="index"
                  >
                    <div
                      v-text="item.Number"
                      style="background: aliceblue"
                    ></div>
                    <div v-text="item.fAddress"></div>
                    <div v-text="item.fFirstcheckvalue"></div>
                    <div v-text="item.fCheckpointnumber"></div>
                    <div v-text="item.fXy"></div>
                  </div>
                </div>
                <div class="Thickness_Form_box">
                  <div class="box1" style="background: aliceblue">
                    <div>序号</div>
                    <div>位置</div>
                    <div>厚度</div>
                    <div>间距</div>
                    <div>合格</div>
                  </div>
                  <div
                    class="box1"
                    v-for="(item, index) in Thickness_FormData_left"
                    :key="index"
                  >
                    <div
                      v-text="item.Number"
                      style="background: aliceblue"
                    ></div>
                    <div v-text="item.fAddress"></div>
                    <div v-text="item.fFirstcheckvalue"></div>
                    <div v-text="item.fCheckpointnumber"></div>
                    <div v-text="item.fXy"></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <div class="Control-2">
        <el-dialog :title="fFileName" v-dialogDrag :visible.sync="dialogPdf">
          <div :style="{ height: dialogHeight }">
            <!-- <iframe
              :src="pdfUrl"
              width="100%"
              height="100%"
              frameborder="0"
            ></iframe> -->
            <embed :src="`${pdfUrl}#toolbar=0`" hidden="false" type="application/pdf" height="100%" width="100%" />
          </div>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

<script>
import tree from "@/components/public/common-trees";
// import TableData from "@/components/waterManage/public/el-tables"; //主页面列表
// import TableDatas from "@/components/waterManage/public/el-tables"; //主页面列表
// import TableDatas from "@/components/PCManage/el-tables"; //张拉力
import SteelCharts from "@/components/PCManage/SteelCharts_1"; //张拉力

import formJs from "./regexDetail.js"; //新增弹框配置项

import {
  getUserCompanyTreeList,
  getProtectioncoursePageList,
  getProtectioncourseByFid,
  addProtectioncourse,
  
} from "@/api/request.js";
export default {
  inject: ["reload"],
  name: "Steel-1",
  data() {
    return {
      // 分页
      navigatepageNums: null, //是否显示分页
      queryCriteriaData: {},
      echartsHeight: null, //图表高度
      // 上传图
      fPhotofilelist: [],
      dialogPdf: false,
      pdfUrl: "",
      fFileName: "", // 上传附件
      // 上传图

      name: "Steel-1",
      yj_view: null,
      activeIndex: "1",
      highlightBd: true, //左侧机构树停留背景色
      treelength: false, //左侧树显示隐藏
      checked: true, //查看下级
      showName: "未选择公司",
      dialogHeight: "",
      loading: false,
      fId: null,
      // 列表
      getList: {
        modelType: "2", // 0代办 1已办  2查询页面
        fCompanyid: null, //机构id
        fUserid: null, //当前登录用户id
        sublevel: "1", //查看下级  1是0否
        page: 1, //页码
        pageSize: 20, //每页条数
      },

      // 查看
      loadingDialog: false,
      dialogTableVisible: false,
      formData: {
        fId: null, //信息表fid
        fCompanyid: null, //对应机构id
        fCompanyname: null, //对应机构名称
        fProjectid: null, //工程id
        fProjectname: null, //工程名称简称
        fProjectfullname: null, //工程名称全称
        fChecktype: null, //检测类型
        fCheckcompanyid: null, //检测单位id
        fCheckcompanyname: null, //检测单位简称
        fCheckcompanyfullname: null, //检测单位全称
        fClientid: null, //施工委托单位id
        fClientname: null, //施工委托单位简称
        fClientfullname: null, //施工委托单位全称
        fProjectpart: null, //工程部位
        fProjectapplication: null, //工程用途
        fSamplenumber: null, //样品编号
        fSamplename: null, //样品名称
        fSampledescription: null, //样品描述
        fMajorequipnameandnumber: null, //主要仪器设备名称及编号
        fMajorequipname: null,
        fMajorequipnumber: null,
        fCheckenvironment: null, //试验条件
        fRecordnumber: null, //记录编号
        fCheckdate: null,
        fCheckdates: null, //试验检测日期
        fCheckreference: null, //检测依据
        fDecidereference: null, //判定依据
        fComponentname: null, //构件名称
        fDnd: null, //保护层厚度设计值
        fCo: null, //垫块厚度Co
        fStandardvalue: null, //规定值或允许偏差
        fDiameter: null, //钢筋公称直径
        fCc: null, //修正值
        fReportnumber: null, //报告编号
        fAddcomments: null, //附加说明
        fCheckresult: null, //检测结论
        fCheckpointcount: null, //保护层厚度检测点数
        fCheckpointqualifiedcount: null, //合格点数
        fCheckpointqualifiedrate: null, //合格率
        fCheckpointavgthickness: null, //保护层厚度平均值
        fSd: null, //标准偏差
        fDne: null, //保护层厚度特征值
        fRatioofdneanddnd: null, //保护层厚度特征值与设计值的比值   DNE/DND
      },
      sample: null, //样品信息
      recordData: [
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
      ], //记录表1-20数据
      recordData1: [
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
        {
          fId: "", //测点fid
          fParentid: "", //测点对应信息表fid
          fCheckpointnumber: null, //测点编号
          fFirstcheckvalue: "", //第一次检测值
          fSecondcheckvalue: "", //第二次检测值
          fAvgvalue: "", //平均值
          fSdvalue: "", //偏差值
          fResultdecide: "", //结果判定
          fIsdeleted: null,
        },
      ], //记录表21-40数据

      row: null,
      // 左侧树
      companyTree: "", //所有数据
      formLabelWidth: "82px",
      treeData: [], //左侧树
      tableData: [], //表格数据列表
      defaultProps: {
        children: "children",
        label: "fShortname",
      }, //左侧树结构 判定条件
      companyId: null,
      userInfo: {}, //登录用户
      treeText: {
        companyId: null,
        userId: null,
      },
      checkData: [], //选中tree状态id
      addData: null, //反调新增接口

      // 图表
      listLoading: false,
      table_config: formJs.table_config,
      Thickness_FormData_right: [],
      Thickness_FormData_left: [],
      chartsLoading: false,
      tensioningData: [], //张拉力--图表数据
      // 图表
    };
  },
  components: {
    tree,
    // TableData,
    // TableDatas,
    SteelCharts,
  },
  mounted() {
    this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
    if (JSON.parse(sessionStorage.getItem("engineerList"))) {
      var id = JSON.parse(sessionStorage.getItem("engineerList"));
      this.checkData = [id.fCompanyid];
    }
    this.getHeight();
    this.getTree();
    this.tableCode();
    this.btnRole(this.name);
  },
  methods: {
    // 控制按钮
    btnRole(name) {
      var btnList = [];
      var ModuleList = JSON.parse(sessionStorage.getItem("ModuleList"));
      if (ModuleList.length > 0) {
        ModuleList.map((item) => {
          if (item.fEncode == name) {
            btnList = item.modulebuttonList;
          }
        });
        var btnStr = [];
        btnList.map((item) => {
          btnStr.push(item.fEncode);
        });

        this.yj_view = btnStr.includes("yj_view");
      } else {
        this.yj_view = true;
      }
    },
    // 左侧树结构
    getTree() {
      this.treeText.companyId = this.userInfo.companyId;
      this.treeText.userId = this.userInfo.userId;
      getUserCompanyTreeList(this.treeText)
        .then((res) => {
          if (res.errcode == 0) {
            var companyTree = res.data.userCompanyTreeList;
            this.treeData = this.commonJs.tranListToTreeData(companyTree);

            if (this.treeData[0].children == undefined) {
              this.treelength = false;
            } else {
              this.treelength = true;
            }

            if (this.checkData[0]) {
              this.showName = JSON.parse(
                sessionStorage.getItem("engineerList")
              ).fShortname;
              this.companyId = this.checkData[0];
              this.getList.fCompanyid = this.checkData[0];
            } else {
              this.showName = this.treeData[0].fShortname; //当前点击组织机构名称
              this.getList.fCompanyid = this.treeData[0].fCompanyid; //当前点击组织机构ID
              this.companyId = this.treeData[0].fCompanyid;
              this.checkData[0] = this.treeData[0].fCompanyid;
            }

            this.getDataList(this.getList);
            // 列表
          } else {
            this.$message.error(res.msg);
            // this.$message.error("获取组织机构失败");
            return false;
          }
        })
        .catch(() => {
          return false;
        });
    },

    // 获取列表数据
    getDataList(id) {
      this.loading = true;
      this.fId = "";
      id.fUserid = this.userInfo.userId;
      getProtectioncoursePageList(id)
        .then((res) => {
          if (res.errcode == 0) {
            var that = this;
            that.loading = false;
            that.tableData = res.data.protectioncourseList.list;
            that.queryCriteriaData = res.data.protectioncourseList;
            that.navigatepageNums =
              that.queryCriteriaData.navigatepageNums.length;
          } else {
            this.$message.error("列表数据", res.msg);
            this.loading = false;
          }
        })
        .catch(() => {
          console.log("获取列表数据失败");
          this.loading = false;
        });
    },
    // 页面切换
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.getList.page = val;
      this.getDataList(this.getList);
    },
    //查看下级
    see() {
      if (this.checked == true) {
        this.getList.sublevel = 1;
      } else {
        this.getList.sublevel = 0;
      }
      this.getDataList(this.getList);
    },
    //查看
    editText(row, num) {
      this.fPhotofilelist = [];
      this.fId = row.fId;
      if (this.fId != null && this.fId != "") {
        this.recordData = [];
        this.recordData1 = [];
        this.dialogTableVisible = true;
        this.loadingDialog = true;
        if (num == 1) {
          this.activeIndex = "1";
        } else if (num == 2) {
          this.activeIndex = "1";
        } else if (num == 3) {
          this.activeIndex = "1";
        } else if (num == 4) {
          this.activeIndex = "2";
        }
        getProtectioncourseByFid({ fId: this.fId })
          .then((res) => {
            if (res.errcode == 0) {
              var that = this;
              that.loadingDialog = false;
              that.formData = res.data.checkProtectioncourse;
              // 钢筋保护层厚度检测示意图
              var Thickness_FormData = [];
              this.Thickness_FormData_right = [];
              this.Thickness_FormData_left = [];
              this.tensioningData = [[], [], "", []];
              // this.tensioningData = [[X轴数据], [Y轴数据], "标准线"];
              var dataFrom = {
                Number: null, //序号
                fAddress: "", //位置
                fFirstcheckvalue: "", //厚度
                fCheckpointnumber: "", //间距
                fXy: "", //是否合格
              };

              that.formData.checkPointList.map((item, index) => {
                if (item.fXy == "-1") {
                  item.fXy = "不合格";
                } else if (item.fXy == "1") {
                  item.fXy = "合格";
                }
                if (index == 0) {
                  dataFrom = {
                    Number: index + 1,
                    fAddress: item.fAddress,
                    fFirstcheckvalue: item.fFirstcheckvalue,
                    fCheckpointnumber: item.fAddress,
                    fXy: item.fXy,
                  };
                } else {
                  if (
                    item.fFirstcheckvalue == "" ||
                    item.fFirstcheckvalue == null
                  ) {
                    dataFrom = {
                      Number: index + 1,
                      fAddress: "/",
                      fFirstcheckvalue: "/",
                      fCheckpointnumber: "/",
                      fXy: "/",
                    };
                  } else {
                    dataFrom = {
                      Number: index + 1,
                      fAddress: item.fAddress,
                      fFirstcheckvalue: item.fFirstcheckvalue,
                      fCheckpointnumber: (
                        item.fAddress -
                        that.formData.checkPointList[index - 1].fAddress
                      ).toString(),
                      fXy: item.fXy,
                    };
                  }
                }

                if (dataFrom.fFirstcheckvalue != "/") {
                  this.tensioningData[0].push(dataFrom.fAddress);
                }
                if (dataFrom.fCheckpointnumber != "/") {
                  this.tensioningData[1].push(dataFrom.fFirstcheckvalue);
                  this.tensioningData[3].push(dataFrom.fCheckpointnumber);
                }

                // fCheckpointnumber
                this.tensioningData[2] = this.formData.fDnd;
                Thickness_FormData.push(dataFrom);
              });

              Thickness_FormData.map((item, index) => {
                if (index < 20) {
                  this.Thickness_FormData_right.push(item);
                } else {
                  this.Thickness_FormData_left.push(item);
                }
              });
              // 钢筋保护层厚度检测示意图

              that.addData = res.data;
              for (
                let index = 0;
                index < that.formData.checkPointList.length;
                index++
              ) {
                const element = that.formData.checkPointList[index];
                if (index < 20) {
                  that.recordData.push(element);
                } else {
                  that.recordData1.push(element);
                }
              }
              that.sample =
                "样品名称:" +
                that.formData.fSamplename +
                "; " +
                "样品编号:" +
                that.formData.fSamplenumber +
                "; " +
                "样品状态:" +
                that.formData.fSampledescription +
                "; ";
              that.fPhotofilelist = res.data.checkpartimage;
              // 计算
              if (
                this.formData.fDiameter != "" &&
                this.formData.fCc != "" &&
                this.formData.fDnd != "" &&
                this.formData.fCo != "" &&
                this.formData.fStandardvalue != "" &&
                this.formData.fDiameter != null &&
                this.formData.fCc != null &&
                this.formData.fDnd != null &&
                this.formData.fCo != null &&
                this.formData.fStandardvalue != null
              ) {
                this.inputCheckpointnumber();
              } else {
                console.log("值不全，无法自动计算");
              }
              // 计算
            } else {
              this.$message.error("记录表/报告表", res.msg);
              this.loadingDialog = false;
            }
          })
          .catch(() => {
            console.log("记录表/报告表");
            this.loadingDialog = false;
          });
      } else {
        return this.$message.error("请先选择需查看的数据");
      }
    },
    // 计算
    inputCheckpointnumber() {
      // this.formData.checkPointList = this.recordData.concat(this.recordData1);
      // 钢筋工称直径和修正值带入
      for (
        let index = 0;
        index < this.formData.checkPointList.length;
        index++
      ) {
        const element = this.formData.checkPointList[index];
        if (
          element.fSecondcheckvalue != "" &&
          element.fSecondcheckvalue != null &&
          element.fFirstcheckvalue != null &&
          element.fFirstcheckvalue != ""
        ) {
          element.fDiameter = this.formData.fDiameter;
          element.fCc = this.formData.fCc;
          //  平均检测值
          if (
            Number(element.fFirstcheckvalue - element.fSecondcheckvalue) > 1 ||
            Number(element.fSecondcheckvalue - element.fFirstcheckvalue) > 1
          ) {
            element.fAvgvalue = "无效";
            element.fSdvalue = "无效";
          } else {
            var Avgvalue;
            Avgvalue =
              (Number(element.fSecondcheckvalue) +
                Number(element.fFirstcheckvalue) +
                2 * Number(element.fCc) -
                2 * Number(this.formData.fCo)) /
              2;

            if (parseInt(Avgvalue) === parseFloat(Avgvalue)) {
              element.fAvgvalue = Avgvalue.toFixed(0);
            } else {
              var arr = Avgvalue.toString().split(".");
              if (arr[1].length > 1) {
                element.fAvgvalue = arr[0] - 0 + 1;
              } else {
                if ((arr[0] - 0) % 2 == 0) {
                  element.fAvgvalue = arr[0] - 0;
                } else {
                  element.fAvgvalue = arr[0] - 0 + 1;
                }
              }
            }

            element.fAvgvalue = element.fAvgvalue + "";

            //偏差值
            element.fSdvalue = Number(element.fAvgvalue - this.formData.fDnd)
              .toFixed(0)
              .toString();
          }
        } else {
          element.fDiameter = "";
          element.fAvgvalue = "";
          element.fSdvalue = "";
          element.fResultdecide = "";
          element.fCc = "";
        }
      }

      this.calculation();
    },

    calculation() {
      let CheckpointcountNum = 0; //  检测点数
      let StandardvaluNum = 0; //合格点数
      let StandardvaluNums = 0; //有效点数
      let StandardvaluNumAllin = 0; //所有合格点数平均值总和
      let fSdvaluNum = 0; //偏差平方总和
      let standard = 0; //标准差
      let Checkpointavgthickness = 0; //保护层厚度平均值
      let features = 0; //保护层厚度特征值

      for (
        let index = 0;
        index < this.formData.checkPointList.length;
        index++
      ) {
        const element = this.formData.checkPointList[index];
        // 检测点数
        if (element.fFirstcheckvalue != "" || element.fSecondcheckvalue != "") {
          CheckpointcountNum++;
          // 判定系数
          if (CheckpointcountNum >= 25) {
            this.formData.fThicknessdecidecoefficient = "1.595";
          } else if (24 >= CheckpointcountNum && CheckpointcountNum >= 16) {
            this.formData.fThicknessdecidecoefficient = "1.645";
          } else if (15 >= CheckpointcountNum && CheckpointcountNum >= 10) {
            this.formData.fThicknessdecidecoefficient = "1.695";
          }
        }

        // 合格点数
        if (element.fSdvalue != "无效" && element.fSdvalue != "") {
          var StandardvaluArr = this.formData.fStandardvalue.split(",");
          if (
            Number(StandardvaluArr[0]) <= Number(element.fSdvalue) &&
            Number(element.fSdvalue) <= Number(StandardvaluArr[1])
          ) {
            element.fResultdecide = "合格";
            StandardvaluNum++; //合格点数
          }
        } else {
          if (
            element.fFirstcheckvalue != "" ||
            element.fSecondcheckvalue != ""
          ) {
            element.fResultdecide = "不合格";
          }
        }

        this.formData.fCheckpointcount = CheckpointcountNum.toString(); //检测点数
        this.formData.fCheckpointqualifiedcount = StandardvaluNum.toString(); //合格点数
        //有效点数
        if (element.fAvgvalue != "无效" && element.fAvgvalue != "") {
          StandardvaluNums++; //有效点数
          StandardvaluNumAllin += Number(element.fAvgvalue); //所有有效点数平均值总和
        }
      }

      //保护层厚度平均值
      if (StandardvaluNums == 0) {
        this.formData.fCheckpointavgthickness = "0";
      } else {
        Checkpointavgthickness = (
          StandardvaluNumAllin / StandardvaluNums
        ).toFixed(1);
        this.formData.fCheckpointavgthickness =
          Checkpointavgthickness.toString();
      }
      //  标准差
      if (StandardvaluNums > 1) {
        for (
          let index = 0;
          index < this.formData.checkPointList.length;
          index++
        ) {
          const element = this.formData.checkPointList[index];
          // 标准差分子平方和
          if (element.fAvgvalue != "无效" && element.fAvgvalue != "") {
            fSdvaluNum += Math.pow(
              Number(element.fAvgvalue - Checkpointavgthickness),
              2
            ); //偏差平方总和
          }
        }
        standard = Math.sqrt(fSdvaluNum / (StandardvaluNums - 1)).toFixed(1);
        this.formData.fSd = standard.toString();
      } else {
        this.formData.fSd = "0";
      }
      // 保护层厚度特征值
      if (CheckpointcountNum >= 10) {
        features = (
          Checkpointavgthickness -
          standard * Number(this.formData.fThicknessdecidecoefficient)
        ).toFixed(1);
        this.formData.fDne = features.toString();
      } else {
        this.formData.fDne = "0";
      }

      //保护层厚度特征值与设计值的比值Dne/Dnd
      this.formData.fRatioofdneanddnd = (features / Number(this.formData.fDnd))
        .toFixed(1)
        .toString();

      // 合格率
      if (StandardvaluNum != 0) {
        this.formData.fCheckpointqualifiedrate = (
          (Number(this.formData.fCheckpointqualifiedcount) /
            Number(this.formData.fCheckpointcount)) *
          100
        ).toFixed(1);
      } else {
        this.formData.fCheckpointqualifiedrate = "0";
      }

      if (
        this.formData.fModifydate == "" ||
        this.formData.fModifydate == null
      ) {
        this.addProtectioncourseFun();
      }
    },

    addProtectioncourseFun() {
      this.addData.checkProtectioncourse.checkPointList =
        this.formData.checkPointList; //表格

      this.addData.checkProtectioncourse.fThicknessdecidecoefficient =
        this.formData.fThicknessdecidecoefficient; //判定系数

      this.addData.checkProtectioncourse.fCheckpointcount =
        this.formData.fCheckpointcount; //检测点数

      this.addData.checkProtectioncourse.fCheckpointqualifiedcount =
        this.formData.fCheckpointqualifiedcount; //合格点数

      this.addData.checkProtectioncourse.fCheckpointqualifiedrate =
        this.formData.fCheckpointqualifiedrate; //合格率

      this.addData.checkProtectioncourse.fCheckpointavgthickness =
        this.formData.fCheckpointavgthickness; //保护层厚度平均值

      this.addData.checkProtectioncourse.fSd = this.formData.fSd; //标准差

      this.addData.checkProtectioncourse.fDne = this.formData.fDne; // 保护层厚度特征值

      this.addData.checkProtectioncourse.fRatioofdneanddnd =
        this.formData.fRatioofdneanddnd; //保护层厚度特征值与设计值的比值Dne/Dnd
      this.addData.checkProtectioncourse.isSubmit = "1";
      addProtectioncourse(this.addData.checkProtectioncourse)
        .then((res) => {
          if (res.errcode == 0) {
            console.log("页面重新计算---保存成功");
          } else {
            console.log("页面重新计算---保存失败");
            this.loading = false;
          }
        })
        .catch(() => {
          console.log("页面重新计算---保存接口失败");
          this.loading = false;
        });
    },
    // 计算
    openPdfs(v) {
      this.dialogPdf = true;
      this.pdfUrl = v.url;
      this.fFileName = v.fFileName;
    },

    // 打印

    Print(e) {
      if (e == 1) {
        console.log("记录");
        window.open(
          "http://1.14.19.236:8054/concreteScreen/App/upload/getProtectioncourseRecordPDF.do?fId=" +
            this.fId
        );
      } else {
        console.log("报告");
        window.open(
          "http://1.14.19.236:8054/concreteScreen/App/upload/getProtectioncourseReportPDF.do?fId=" +
            this.fId
        );
      }
    },
    //表格生成编码
    tableCode() {
      for (let index = 0; index < this.recordData.length; index++) {
        this.recordData[index].fCheckpointnumber = index + 1;
        this.recordData1[index].fCheckpointnumber = index + 21;
      }
    },
    handleSelect(key) {
      this.activeIndex = key;
    },
    // 关闭
    resetForm() {
      this.dialogTableVisible = false;
      this.reload();
    },

    // 点击当前行
    getRowInfo(e) {
      this.row = e;
      this.fId = e.fId;
    },

    // 点击当前行变色
    rowChange(val) {
      this.currentRow = val;
    },

    // 获取页面容器高度
    getHeight() {
      var h = document.documentElement.clientHeight; //获取页面可见高度
      this.echartsHeight = (h * 0.95 - 23) * 0.45;
      this.dialogHeight = h * 0.98 + "px";
    },
    // 点击左侧机构树
    handleNodeClick(data) {
      if (this.checked == true) {
        this.getList.sublevel = 1;
      } else {
        this.getList.sublevel = 0;
      }
      this.showName = data.fShortname; //顶部显示机构名
      this.getList.fCompanyid = data.fCompanyid;
      this.getDataList(this.getList);
    },
  },
};
</script>

<style scoped lang='less'>
.printTables {
  background: #fff;
  display: flex;
  justify-content: end;
  padding: 5px;
  margin-top: 10px;
}

.dialogBody {
  padding: 3px 20px;
  height: 80%;
  overflow-y: auto;
}

.pageFlagText {
  color: #171a1d;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: #000;
}

.ThicknessMap {
  width: 100%;
  height: calc(100% - 23px);
  color: #606266 !important;
  font-size: 12px;

  // font-weight: 700;
  .Thickness_Map {
    width: 100%;
    height: 45%;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 10px;
  }

  .Thickness_Form {
    width: 100%;
    height: 45%;
    display: flex;

    .Thickness_Form_box {
      width: 50%;
      height: 100%;
      display: flex;
      flex-wrap: wrap;
      border: 1px solid #ccc;

      .box1 {
        width: 100%;
        height: 4.7%;
        display: flex;
        border-bottom: 1px solid #ccc;

        div {
          width: 20%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          border-right: 1px solid #ccc;
        }
      }
    }

    .box1:last-child {
      border-bottom: none;
    }

    .Thickness_Form_box:nth-child(1) {
      border-right: none;
    }

    .box1 div:last-child {
      border-right: none;
    }
  }
}
</style>